public class Rastro{
  PowerBall pb;
  Ball bola;
  float x[];
  float y[];
  int j, rastroMax;
  color cor;
  
  Rastro(Ball bola, color cor){
    j=0;
    rastroMax = 41;
    this.bola=bola;
    this.cor=cor;
    x = new float[rastroMax];
    y = new float[rastroMax];
    zera();
  }
  
  void setPowerBall(PowerBall pb){
    this.pb=pb;
  }
  
  void start(){
    pegaCoord();
    desenha();
  }
  
  void desenha(){
    ellipseMode(RADIUS);
    noStroke();
    fill(cor,50);
    for(int i=0; i<pb.power; i++)
      ellipse(x[i], y[i], i*2, i*2);
  } 
 
   void pegaCoord(){
     x[j] = bola.x;
     y[j] = bola.y;
     
     
     
     if(j<pb.power)
       j++;
     else
       j=0;  
   }
  
  void zera(){
    
    
    for(int i =0; i<x.length; i++){
      x[i]=-100;
      y[i]=-100;
    }
  }   
  
}//termina a classe
